package com.ruoyi.book.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.book.mapper.FictionShelfMapper;
import com.ruoyi.book.domain.FictionShelf;
import com.ruoyi.book.service.IFictionShelfService;

/**
 * 书架Service业务层处理
 * 
 * @author 沉睡
 * @date 2024-08-05
 */
@Service
public class FictionShelfServiceImpl implements IFictionShelfService 
{
    @Autowired
    private FictionShelfMapper fictionShelfMapper;

    /**
     * 查询书架
     * 
     * @param id 书架主键
     * @return 书架
     */
    @Override
    public FictionShelf selectFictionShelfById(Long id)
    {
        return fictionShelfMapper.selectFictionShelfById(id);
    }

    /**
     * 查询书架列表
     * 
     * @param fictionShelf 书架
     * @return 书架
     */
    @Override
    public List<FictionShelf> selectFictionShelfList(FictionShelf fictionShelf)
    {
        return fictionShelfMapper.selectFictionShelfList(fictionShelf);
    }

    /**
     * 新增书架
     * 
     * @param fictionShelf 书架
     * @return 结果
     */
    @Override
    public int insertFictionShelf(FictionShelf fictionShelf)
    {
        fictionShelf.setCreateTime(DateUtils.getNowDate());
        return fictionShelfMapper.insertFictionShelf(fictionShelf);
    }

    /**
     * 修改书架
     * 
     * @param fictionShelf 书架
     * @return 结果
     */
    @Override
    public int updateFictionShelf(FictionShelf fictionShelf)
    {
        return fictionShelfMapper.updateFictionShelf(fictionShelf);
    }

    /**
     * 批量删除书架
     * 
     * @param ids 需要删除的书架主键
     * @return 结果
     */
    @Override
    public int deleteFictionShelfByIds(Long[] ids)
    {
        return fictionShelfMapper.deleteFictionShelfByIds(ids);
    }

    /**
     * 删除书架信息
     * 
     * @param id 书架主键
     * @return 结果
     */
    @Override
    public int deleteFictionShelfById(Long id)
    {
        return fictionShelfMapper.deleteFictionShelfById(id);
    }
}
